package model

import (
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:varchar(20);unique;not null"`
	Password string `gorm:"type:varchar(32);not null"`
}

func (u *User) GetOneFile(db *gorm.DB) error {
	return db.Model(&u).Where("mobile = ?", u.Mobile).Limit(1).Find(u).Error
}
func (u *User) Create(db *gorm.DB) error {
	return db.Model(&u).Create(&u).Error
}
